The invention relates to a method and a device for counting clock pulses for the purpose of measuring period lengths which occur in one or more measuring channels arranged in parallel.
Such a method is used, for example, for the high-precision measurement of the speed characteristic of shafts and wheels of driving or driven systems. In this case, a co-rotating device, for example a toothed wheel or an optical pulse disc, is provided on which incremental marks are arranged at an equidistant angular spacing. The incremental marks pass by a sensor head and cause measurement events there, for example the transition from optical transparency to opacity and vice versa in the case of an optical pulse disc, the temporal spacing of which events is a measure of the rotational angle of the rotating system. It is possible in this way to determine the speed via a period length measurement by counting temporally equidistant clock pulses during a respective period situated between two such events. Such pulse counting is performed in one or more measuring channels each of which is assigned a specific period length sequence. Thus, a measuring channel corresponds to each disc track in the case of an optical pulse disc.
The period lengths can vary between very high values, corresponding to a very slowly rotating system, and very small values, corresponding to a very quickly rotating system. If period lengths within a large range of values are to be detected, resolving short period lengths requires the use of a high reference clock frequency for the clock pulses, which can be over 10 MHz, for example, while detecting long period lengths, a correspondingly high counting capacity for the pulse counting is required. If one individual, separate counter is provided per measuring channel, this counter is therefore to be dimensioned appropriately large, that is to say its counting capacity must cover the longest period to be expected. In the case of high clock frequencies, the readout time required for such a counter can become larger than the spacing between two clock pulses. In order not to lose any pulses, which could give rise to measurement errors, it is known to arrange two similar channel counters per measuring channel in each case. Of these, one is respectively in counting operation during a period while the other is stopped, and its value is stored in an associated register and thereupon said counter is reset to zero and restarted at the beginning of the next period. At the end of one period and the simultaneous start of the next period, the active counting functions of the two counters alternate correspondingly. It is therefore necessary in this mode of procedure either to provide two counters per measuring channel with a counting capacity adapted to the longest period to be expected, or else to provide prescaling of the reference clock frequency. The first solution necessitates a corresponding outlay on components, and the second solution can impair the measurement accuracy, and leads to complicated and error-rife case discriminations in the evaluation of measured data.
The known period measurement by means of pulse counting using two alternating counters per measuring channel is a relative time measurement, that is to say the absolute time from the start of measurement is yielded by summing all the measured individual period lengths of a measuring channel, as a result of which there is the risk that individual errors are likewise summed, and this can be attended by the loss of a correct time reference between different measuring channels.
An object of the present invention is to provide a method and a device for counting clock pulses which in conjunction with a low outlay on components permits error-free measurement even of comparatively long period lengths in simultaneous conjunction with a high temporal resolution for comparatively short period lengths.
This and other objects are achieved by the present invention which provides a method for counting clock pulses for measuring period lengths in a number n of measuring channels with n greater than or equal to one, during a prescribed measurement period, comprising the steps:
a) simultaneously starting, at a start of measurement, of m.sub.i -digit channel counters separately provided for each measuring channel, and an h-digit main counter, h being greater than all the m.sub.1, PA1 b) upon occurrence of a period end in one of the measuring channels, stopping the channel counter of that measuring channel and reading out m.sub.j count positions from that channel counter, reading out h-m.sub.j higher-order count positions of the main counter and forming an L-digit total count value, which combines the two read-out count positions and represents a temporal spacing of said period end from the start of measurement, PA1 c) after readout of the channel counter, starting this channel counter again and synchronized with the m.sub.j lower-value count positions of the main counter, which have continued to run, PA1 d) repeating steps b) and c) up to a specifiable measurement period end, and PA1 e) respectively determining the number of counting pulses which has occurred between the start and the end of each period of each measuring channel and is representative of the respective period length, by subtracting the count value belonging to the period start from the count value belonging to the period end for each period.
The present invention has the advantage that only a single channel counter and a main counter common to all the channels are required per measuring channel. The low outlay on components is the more effective the more measuring channels are present. A high clock frequency can be used for the purpose of period length measurement, since the main counter continues to count uninterruptedly. By stopping the associated channel counter at the end of each period within a measuring channel and reading out the value counted by this counter as well as reading out the higher-order count position part of the main counter, the absolute duration of the time elapsed from the start of measurement up to this period end is detected in each case, and the respective period length is determined by forming the difference of two successive count values.
The lower-order count position part, corresponding in its counting capacity to the respective channel counter, therefore does not need to be stopped, since the corresponding counting result is taken from the channel counter and is therefore able to count further even during a readout operation of a channel counter and of the higher-order count position part of the main counter. Consequently, even the clock pulses occurring during a readout operation, which by their nature have a stronger effect in changing a count position the lower the order of the count position, can be detected without gaps, that is to say counted. This permits the use of clock frequencies which the time intervals of the pulses are smaller than the time required to read out the counter, without there being a need to provide for each counting channel two channel counters or in each case a large channel counter corresponding in capacity to the existing main counter.
In certain embodiments of the invention, there are arranged, for a higher-order count position part of the main counter and for each channel counter, registers in which the existing count value is stored at the period end in order for it to be read out from there for further processing, for example in a computer.
In certain embodiments of the invention, each measuring channel is additionally assigned a carry counter and a register therefor, the carry counter needing to have only a very low counting capacity, that is to say one or a few count positions. Its count positions adjoin the highest-order count position of the respective channel counter and to this extent overlap with the lower-order range of the higher-order count position part of the main counter. When such carry counters are arranged, a correct count value is obtained even if one or more of the channel counters should overflow in the meantime during reading out of a count value, previously obtained and stored in the main counter register, from this register. Each such overflowing of a channel counter then results in an increase by one in the count value in the assigned carry counter.
The main counter is to be at least so large that it can count all the pulses occurring within a period of maximum length, while the channel counters together with optionally provided carry counters must be so large that they are able to detect the pulse number during the readout time for all active channels by means of a control computer. This guarantees in satisfying a real-time condition for readout that no readout errors occur even in the most unfavorable case in which in each case an immediately adjacent channel and carry counter stops shortly before the end of the readout operation for a preceding measuring channel and is due for readout. It is preferred for all the carry counters to be reset jointly to zero after the end of such a readout chain, but it is also possible to reset each carry counter separately after its readout.
In certain embodiments of the invention, the main counter is so large that it can count all the pulses occurring within the total measurement period, and the channel is dimensioned together with the carry counters in such a way that they are able to count a period of maximum length occurring in the respective measuring channel. This permits continuous measurement of absolute time during the total measurement period without additional software measures, and this overcomes the difficulties of the known relative time measurement.
In the known relative time measurement the juxtaposition of the individual period lengths means that even a single occurrence of a stochastic error, for example a peak on the measurement signal, leads to shifting of all the following measured values on the time axis, which in the case of multichannel measurements of period lengths or in the case of a measurement, carried out in parallel, of other physical quantities, for example a pressure or torque, leads to a loss of the mutual time reference between the measuring channels. By contrast, the absolute time measurement according to the present invention has the further advantage that only the time reference of the defective measured value is lost, whereas the time reference of all of the following measured values is retained, and this permits the mutual temporal assignment.
Furthermore, in the known relative time measurement using two counters per measuring channel, switching over between these could lead to inaccuracies in counting the reference frequency, which add up given the juxtaposition of the individual period lengths to form the time characteristic of the entire measurement operation. The absolute time measurement of the present invention, with the continuously counting, non-stop main counter avoids this potential source of error.
In addition, during an operation with essentially similar period lengths it is possible with this absolute time measurement for missing measured values due to stochastic errors, for example in the case of storage of count values, to be detected as outliers which have approximately double the period length, whereas in the known relative time measurement such errors likewise cannot be detected in normal operation.
Other objects, advantages and novel features of the present invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings.